<?php
	

class NBEventMapHelper
{

	public static function addSubmenu($vName = 'accueil')
	{
		JSubMenuHelper::addEntry(
			JText::_('NBEVENTMAP_ACCUEIL'),
			'index.php?option=com_nbeventmap&controller=accueil&task=view',
			$vName == 'accueil'
		);

		JSubMenuHelper::addEntry(
			JText::_('NBEVENTMAP_LIEUX'),
			'index.php?option=com_nbeventmap&controller=nbeventmap&task=view',
			$vName == 'nbeventmap'
		);

		JSubMenuHelper::addEntry(
			JText::_('NBEVENTMAP_MARQUEURS'),
			'index.php?option=com_nbeventmap&controller=marqueurs&task=view',
			$vName == 'marqueurs'
		);

		JSubMenuHelper::addEntry(
			JText::_('NBEVENTMAP_CATEGORIES'),
			'index.php?option=com_categories&extension=com_nbeventmap',
			$vName == 'categories'
		);
		if ($vName=='categories') {
			JToolBarHelper::title(
				JText::sprintf('COM_CATEGORIES_CATEGORIES_TITLE',JText::_('COM_NBEVENTMAP')),
				'nbeventmap-categories');
		}

		JSubMenuHelper::addEntry(
			JText::_('NBEVENTMAP_PERSONNALISATION'),
			'index.php?option=com_nbeventmap&controller=personnalisations&task=view',
			$vName == 'personnalisations'
		);

		JSubMenuHelper::addEntry(
			JText::_('CSS'),
			'index.php?option=com_nbeventmap&controller=css&task=view',
			$vName == 'css'
		);
	}

	public static function getActions($categoryId = 0)
	{
		die(print_r('administrator\components\com_nbeventmap\helpers\nbeventmaps.php getActions'));
		$user	= JFactory::getUser();
		$result	= new JObject;

		if (empty($categoryId)) {
			$assetName = 'com_nbeventmap';
		} else {
			$assetName = 'com_nbeventmap.category.'.(int) $categoryId;
		}

		$actions = array(
			'core.admin', 'core.manage', 'core.create', 'core.edit', 'core.edit.state', 'core.delete'
		);

		foreach ($actions as $action) {
			$result->set($action,	$user->authorise($action, $assetName));
		}

		return $result;
	}
}
